package com.voyer.web;

import com.voyer.rabbitmq.HelloSender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by wzy on 2018/4/4.
 */
@RestController
public class HelloWorldController {
    @Value("${server.port}")
    String port;
    @RequestMapping(value = "hi")
    public String hello(){
        return "hello world! I am from " + port;
    }

    @Autowired
    private HelloSender helloSender;

    @PostMapping("/hello")
    public void sender() {
        helloSender.send();
    }
}
